<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class News_model extends MY_Model{

	function  __construct(){
		parent::__construct();
		$this->_table = TBL_NEWS;
	}
	
	function get_category($category_id = 0){
        $this->db->select('*')->from(TBL_NEWS_CATEGORY)->order_by('category_id DESC');

        if ($category_id != 0){
            return $this->db->where('category_id', $category_id)->get()->row_array();
        } else {
            return $this->db->get()->result_array();
        }
    }
}